(function ({form,layer,url,contentType,ok}) {
    if (window != top){
        top.location.href = location.href;
    }
    form.on('submit(login)',({field})=>{
        $.ajax({
            type:'post',
            url:url,
            data:field,
            success:(data) => (data.code=="200"?(window.location.href=data.href):ok(data.msg,5))
        })
        return false;
    })

})({
    form: layui.form,
    layer: layui.layer,
    url: "/evaluation/login",
    contentType: 'application/json;charset=utf-8',
    ok: function (msg, icon) {
        layui.layer.confirm(msg, {
            id: "ok",
            icon: icon,
            anim: 4,
            title: '提示',
            btn: ['确定'],
            closeBtn: false,
            success: function (layero) {
                var btn = layero[0].getElementsByClassName('layui-layer-btn')[0].getElementsByTagName('A')[0];
                btn.href = 'javascript:void(0)';
                btn.focus();
            },
            yes: function (index, layero) {
                layer.close(index); //再执行关闭
            },
            end: function () {

            }
        });
    },
})